/**********************************************************************
 * LeechCraft - modular cross-platform feature rich internet client.
 * Copyright (C) 2006-2014  Georg Rudoy
 *
 * Distributed under the Boost Software License, Version 1.0.
 * (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
 **********************************************************************/

#include "httstream.h"
#include <util/core/util.h>
#include "httpstreamfilter.h"

namespace SailmiPIM
{
namespace Plugin::MultiPlayer
{
namespace HttStream
{
	void Plugin::Init (ICoreProxy_ptr)
	{
        Util::InstallTranslator ("smp_httstream");
	}

	void Plugin::SecondInit ()
	{
	}

	void Plugin::Release ()
	{
	}

	QByteArray Plugin::GetUniqueID () const
	{
		return "com.sailmi.pim.plugin.MultiPlayer.HttStream";
	}

	QString Plugin::GetName () const
	{
        return "SMP HttStream";
	}

	QString Plugin::GetInfo () const
	{
        return tr ("Adds support for streaming music played in SMP via HTTP.");
	}

	QIcon Plugin::GetIcon () const
	{
		return {};
	}

	QSet<QByteArray> Plugin::GetPluginClasses () const
	{
		QSet<QByteArray> result;
		result << "com.sailmi.pim.plugin.MultiPlayer.FiltersProvider";
		return result;
	}

	void Plugin::SetMultiPlayerProxy (IMultiPlayerProxy_ptr)
	{
	}

	QList<EffectInfo> Plugin::GetEffects () const
	{
		return
		{
			{
				GetUniqueID () + ".Filter",
				tr ("HTTP streaming"),
				{},
				false,
				[this] (const QByteArray& instance, IPath *path) -> IFilterElement*
				{
					return new HttpStreamFilter
						{
							GetUniqueID () + ".Filter",
							instance,
							path
						};
				}
			}
		};
	}
}
}
}

SAILMIPIM_EXPORT_PLUGIN (sailmipim_smp_httstream, SailmiPIM::Plugin::MultiPlayer::HttStream::Plugin);
